package com.example.http.two.model

/**
 * 商城接口基
 */
open class BaseOpenApiModel(
    val code: String? = null,
    val context: String = "",
    var detail: String = "",
    val message: String = "",
    val partnerId: String = "",
    val requestNo: String = "",
    val service: String = "",
    var success: Boolean = false,
    val version: String = "",
){
    //有些接口错误是detail是空 message才有错误信息
    fun setDetailIfEmpty() {
        if (detail.isEmpty()) detail = message
    }
}

data class CommonListMallApiModel<T>(
    val mallAdInfo:MutableList<T>
):BaseOpenApiModel()

//{"id":75,"imageUrl":"https://jystest-resource.iwubida.com/smartdms/2024/09/2zVRcKTJBZgTZ4Typwjr-.png","name":"骑士节","productType":"","type":"out","url":"http://iov.cineco.cc:10008/mobile/prize"}
data class AdInfoModel(
    val id: Int,
    val imageUrl: String,
    val name: String,
    val productType: String,
    val type: String,
    val url: String
)

